1. Field of the Invention
The present invention relates to a control timing adjustment method, a compilation program, a compiler, and an information processor, and in particular relates to a method of adjusting control timing when the compilation program is executed on an information processor.
2. Description of Related Art
In program development, when a fault in a program detected by an inspection process is corrected, the correction is validated not only for the processing which led to the fault, but also for the processing which had been normal up to then, for all the routes that the correction could potentially affect, so as to avoid degradation.
In recent years, in program development of microcomputers for embedded systems, development techniques are mainly being focused on generating a source program with a high level language (for example, C language), and automatically converting it into a target program written in a low level language (for example, assembly language and machine language) by a compiler.
In general, although development techniques using a high level language reduce programming time and can be focused on design, slight program corrections at the high level language level have an effect on plural positions at the low level language level. The runtime of the programming therefore changes very slightly, and this may lead to faults in program operation which could not be anticipated beforehand. It is thus important from the viewpoint of increasing the efficiency of program development, and reuse of programs, to suppress the increase/decrease in program runtime resulting from program correction in this high level language to the minimum.
Hence, in a computer device such as a microcomputer for embedded systems, the output timing (control timing) of the control signal for controlling an internal process or an external instrument may cause a malfunction due to the aforesaid change of program runtime, and it is therefore necessary to adjust the control timing (hereafter, adjustment of control timing will be referred to as control timing adjustment). Control timing adjustment in a process which demands high precision is performed using the hardware timer and interruption function built into the microcomputer. On the other hand, control timing adjustment in a process which does not demand high precision consists of adjusting the program runtime of the microcomputer so that a desired operation is performed by increasing or decreasing execution instructions at the low level language level.
Patent document 1 discloses a control timing adjustment method in high level language development. Here, the control timing adjustment is performed in three stages.
In the first stage, a compiler (or assembler) generates a target program and step number adjustment objects of the target program by a static analysis of the source program. The step number adjustment objects are a group of dummy instructions which are not accompanied by any actual processing and which are added so that the number of instructions (steps) in all branch routes of the target program are equal. In the second stage, a static analysis is performed on the target program using an actual memory by a linker, the step number adjustment objects are corrected, and an executable program which combines the step number adjustment objects is generated. In the third stage, a dynamic analysis is performed on the executable program using an emulator or a simulator, etc., and the step number adjustment objects are corrected. When correction of the step number adjustment objects is performed in the third stage, the executable program which combines the post-correction step number adjustment objects is regenerated, and the dynamic analysis is repeated.
Specifically, in the technique disclosed in Patent document 1, each time the source program is corrected, an executable program is run, i.e., a dynamic analysis is performed. By running the executable program, i.e., a program described by a machine language (hereafter, machine language program), comparing the runtime of the machine language program before and after correction, and repeating the correction of the step number adjustment objects, a machine language program having an adjusted control timing is finally generated.    [Patent document 1] Japanese Laid Open Patent Application Publication No. 2002-323981